Skip to content

feat: add root-level tools map with customParameters to AI Config types#1295

Merged
jsonbailey merged 5 commits intomainfrom
jb/aic-1935/custom-tool-params
Apr 27, 2026
Merged

feat: add root-level tools map with customParameters to AI Config types#1295
jsonbailey merged 5 commits intomainfrom
jb/aic-1935/custom-tool-params

Conversation

@jsonbailey
Copy link
Copy Markdown
Contributor

@jsonbailey jsonbailey commented Apr 20, 2026

Summary

  • Adds LDTool interface with name, type?, parameters?, and customParameters? fields
  • Adds tools?: { [toolName: string]: LDTool } to LDAICompletionConfig, LDAICompletionConfigDefault, LDAIAgentConfig, and LDAIAgentConfigDefault
  • Updates LDAIConfigFlagValue and LDAIConfigUtils to parse and propagate the root-level tools map
  • Adds test coverage for tools in both completion and agent configs

Background

The LaunchDarkly backend now includes a root-level tools map (sibling to model) in AI Config flag variations. This is separate from model.parameters.tools[] which is the raw array passable to LLM providers as-is. LLM providers reject unknown properties, so customParameters cannot live inside model.parameters.tools[] — hence the split.

Wire format:

{
  "tools": {
    "web-search-tool": {
      "name": "web-search-tool",
      "type": "function",
      "parameters": { ... },
      "customParameters": { "some-custom-parameter": "some-custom-value" }
    }
  }
}

Note

Supersedes PR #1175 (devin/1773277027-add-tool-instructions-examples) which had the wrong structure (array instead of map, wrong fields key/version/instructions/examples, and targeted main instead of feat/ai-sdk-next-release).

Test plan

  • yarn workspace @launchdarkly/server-sdk-ai test — all existing tests pass, 4 new tests for tools map coverage
  • yarn workspace @launchdarkly/server-sdk-ai build — no TypeScript errors
  • yarn workspace @launchdarkly/server-sdk-ai lint — no lint errors

🤖 Generated with Claude Code


Note

Medium Risk
Moderate risk because it expands the public AI Config type surface and changes how flag variations are parsed/serialized, which could affect downstream consumers expecting previous shapes.

Overview
Adds a new root-level tools map to AI Config defaults and evaluated configs (completion and agent) via a new LDTool type that supports customParameters.

Updates LDAIConfigUtils to include tools when building default flag values and to propagate tools from LaunchDarkly flag variations into the returned config objects, with new tests validating presence/absence behavior for both completion and agent configs.

Reviewed by Cursor Bugbot for commit de94725. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions
Copy link
Copy Markdown
Contributor

@launchdarkly/js-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 25623 bytes
Compressed size limit: 29000
Uncompressed size: 125843 bytes

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 20, 2026

@launchdarkly/js-client-sdk size report
This is the brotli compressed size of the ESM build.
Compressed size: 31840 bytes
Compressed size limit: 34000
Uncompressed size: 113634 bytes

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 20, 2026

@launchdarkly/browser size report
This is the brotli compressed size of the ESM build.
Compressed size: 179547 bytes
Compressed size limit: 200000
Uncompressed size: 830815 bytes

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 20, 2026

@launchdarkly/js-client-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 38473 bytes
Compressed size limit: 39000
Uncompressed size: 211104 bytes

Base automatically changed from feat/ai-sdk-next-release to main April 20, 2026 21:04
Adds LDTool interface and tools map (keyed by tool name) to completion
and agent config types. The root-level tools map is distinct from
model.parameters.tools[] which remains passable to LLM providers as-is.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jsonbailey jsonbailey force-pushed the jb/aic-1935/custom-tool-params branch from f83c6ee to 667aebf Compare April 27, 2026 13:34
@jsonbailey jsonbailey marked this pull request as ready for review April 27, 2026 14:10
@jsonbailey jsonbailey requested a review from a team as a code owner April 27, 2026 14:10
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Comment thread packages/sdk/server-ai/__tests__/LDAIClientImpl.test.ts Outdated
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit d0eb383. Configure here.

Comment thread packages/sdk/server-ai/__tests__/LDAIClientImpl.test.ts Outdated
jsonbailey and others added 2 commits April 27, 2026 10:02
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…has no tools

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Comment thread packages/sdk/server-ai/src/api/config/types.ts
@jsonbailey jsonbailey merged commit 487182b into main Apr 27, 2026
42 checks passed
@jsonbailey jsonbailey deleted the jb/aic-1935/custom-tool-params branch April 27, 2026 16:36
@github-actions github-actions Bot mentioned this pull request Apr 27, 2026
joker23 pushed a commit that referenced this pull request Apr 27, 2026
🤖 I have created a release *beep* *boop*
---


<details><summary>jest: 1.0.13</summary>

##
[1.0.13](jest-v1.0.12...jest-v1.0.13)
(2026-04-27)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
* @launchdarkly/react-native-client-sdk bumped from ~10.17.1 to ~10.17.2
</details>

<details><summary>react-native-client-sdk: 10.17.2</summary>

##
[10.17.2](react-native-client-sdk-v10.17.1...react-native-client-sdk-v10.17.2)
(2026-04-27)


### Bug Fixes

* **react-native:** `package.json` should declare esm format
([#1322](#1322))
([149ae73](149ae73))
</details>

<details><summary>server-sdk-ai: 0.18.0</summary>

##
[0.18.0](server-sdk-ai-v0.17.1...server-sdk-ai-v0.18.0)
(2026-04-27)


### Features

* Add root-level tools map with customParameters to AI Config types
([#1295](#1295))
([487182b](487182b))
</details>

<details><summary>server-sdk-ai-langchain: 0.6.0</summary>

##
[0.6.0](server-sdk-ai-langchain-v0.5.6...server-sdk-ai-langchain-v0.6.0)
(2026-04-27)


### Features

* Bump to LangChain 1.0 and drop community package requirement
([#1311](#1311))
([f5a1c29](f5a1c29))


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @launchdarkly/server-sdk-ai bumped from ^0.17.1 to ^0.18.0
  * peerDependencies
    * @launchdarkly/server-sdk-ai bumped from ^0.17.0 to ^0.18.0
</details>

<details><summary>server-sdk-ai-openai: 0.5.7</summary>

##
[0.5.7](server-sdk-ai-openai-v0.5.6...server-sdk-ai-openai-v0.5.7)
(2026-04-27)


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @launchdarkly/server-sdk-ai bumped from ^0.17.1 to ^0.18.0
  * peerDependencies
    * @launchdarkly/server-sdk-ai bumped from ^0.17.0 to ^0.18.0
</details>

<details><summary>server-sdk-ai-vercel: 0.5.7</summary>

##
[0.5.7](server-sdk-ai-vercel-v0.5.6...server-sdk-ai-vercel-v0.5.7)
(2026-04-27)


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @launchdarkly/server-sdk-ai bumped from ^0.17.1 to ^0.18.0
  * peerDependencies
    * @launchdarkly/server-sdk-ai bumped from ^0.17.0 to ^0.18.0
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Primarily a release/version-bump PR, but it updates AI provider
peer/dependency ranges (notably moving `server-sdk-ai-langchain` to
LangChain v1) which may introduce runtime or type-compatibility issues
for consumers.
> 
> **Overview**
> Updates release metadata and publishes new versions of several
packages (`server-sdk-ai` `0.18.0`, `server-sdk-ai-langchain` `0.6.0`,
`server-sdk-ai-openai`/`server-sdk-ai-vercel` `0.5.7`,
`react-native-client-sdk` `10.17.2`, and `@launchdarkly/jest` `1.0.13`).
> 
> This release bumps the AI LangChain provider to *LangChain 1.x* and
aligns AI provider packages’ `@launchdarkly/server-sdk-ai` peer/dev
dependency requirements to `^0.18.0`; examples are updated to consume
the new versions. It also includes a React Native SDK packaging fix
(declaring ESM) and propagates that version bump into the React Native
examples and Jest tooling dependency.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
530460b. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants